import React,{useState} from 'react'

export default function Counter(props) {
  console.log('---------render111-------------');
  console.log('props',props.num);
  let foo=()=>{
    return props.num-50
  }
  const [count,setCount]=useState(foo)
  return (
    <div>
        <h1>计数器</h1>
        <h2>{count}</h2>
        <button onClick={()=>{
            setCount(count+1)
        }}>+</button>
        
    </div>
  )
}
